﻿using System;
using System.Reflection;

namespace Loki.UI
{
    /// <summary>
    /// Common interface for templating engines.
    /// </summary>
    public interface ITemplatingEngine
    {/*
        /// <summary>
        /// Loads the templates definitions.
        /// </summary>
        /// <param name="P_TemplatesDefinitions">The templates definitions.</param>
        void LoadTemplates(params string[] P_TemplatesDefinitions);

        void LoadTemplates(params IContextInstaller[] P_TemplatesDefinitions);

        /// <summary>
        /// Gets the view template for the specified viewmodel.
        /// </summary>
        /// <typeparam name="TView">The type of the view.</typeparam>
        /// <param name="P_ViewModel">The view model.</param>
        IView GetView<TViewModel>(TViewModel P_ViewModel) where TViewModel : IViewModel;

        /// <summary>
        /// Gets the view template for the specified modal viewmodel.
        /// </summary>
        /// <typeparam name="TView">The type of the view.</typeparam>
        /// <param name="P_ViewModel">The view model.</param>
        IModalView GetModalView<TViewModel>(TViewModel P_ViewModel) where TViewModel : IModalViewModel;*/

        object GetTemplate(object model);

        object CreateBind(object view, object viewModel);

        event EventHandler<BindingEventArgs> BindingRequired;

        void RegisterAssociation(Type modelType, Type viewType);

        void RegisterAssociation<TModel, TView>();

        void LoadByConvention(IConventionManager conventionManager, params Assembly[] assemblies);
    }
}